home *** CD-ROM | disk | FTP | other *** search
/ Amiga Game-Power / Amiga Game-Power.iso / power games ii / tetrix / uedit / config!p < prev    next >
Text File  |  1994-05-20  |  10KB  |  300 lines

  1. ======== PRINTER CMDS ========
  2.  
  3. Print the hilite region.  (See alt-p.)
  4. <ctl-p:    print(curFile,hilite) >
  5.  
  6. Select printing port:  parallel, serial, Preferences raw or processed.
  7. <alt-p:    putMsg("Printer select: 0=par: 1=ser: 2=prt: 3=prt: (raw)")
  8.            getKeyVal(macroNum,inputChar)
  9.            sub(n54,inputChar,"0")
  10.            if (geNum(n54,0))  if (gtNum(4,n54)) equateNum(prefPrint,n54)
  11.            putMsg(" ") >
  12.  
  13. Print entire document
  14. <altCtl-p: print(curFile,all)>
  15.  
  16. Stop the current print
  17. <lAmiga-a:  abortPrint abort>
  18.  
  19. Stop all prints that are stored up
  20. <rAmiga-a:  while (abortPrint) nothing
  21.             abort >
  22.  
  23. Restart current print
  24. <lAmiga-s: restartPrint>
  25.  
  26. Give printer control code help
  27. <shftAltCtl-p:  freebuf(buf54)
  28.              putMsg(" ")
  29.              insertRgn(buf54,sFile,
  30. "Press lAmiga-p and then one of the letters below.  For boldface, italics,
  31. 8 lines/inch, etc, the hilite region is bracketed with printer codes:
  32.  
  33. i = italics
  34. u = underline
  35. b = boldface
  36. c = condensed
  37. e = elite
  38. l = enlarged
  39. s = shadow
  40. d = double strike
  41. n = NLQ
  42. x = superscript
  43. y = subscript
  44. 8 = 8 lines/inch
  45.     Other keys:
  46.         rAmiga-g = find next printer code in document
  47.         lAmiga-g = input a printer code # (0-75.  See table in Manual.)
  48. \"Print select\" must be 2 or 3 for these codes to control your printer. 
  49. Select \"Show vals\" to see what print-select is.  Select your printer in
  50. Preferences.
  51.  
  52. ",all)
  53.         flipFlag(buf54,readOnly)
  54.         equateNum(n53,curFile)
  55.         editBuf(buf54)
  56.         vScroll(sFile)
  57.         updateDisplay
  58.         getKey(n54)
  59.         editBuf(buf[n53])
  60.         .. updateDisplay
  61.         freeBuf(buf54) >
  62.  
  63. Get a key and reduce it to lower case.
  64. <virtual-g: putMsg("Enter prtr code (b c d e i l n s u x y 8 h=help):")
  65.             if (getKey(n54)) { mod(n54,n54,104) putMsg(" ") returnTrue }
  66.             putMsg(" ")
  67.             returnFalse >
  68.  
  69. Bracket the hilite region with printer codes using n54
  70. <virtual-c: if (geLoc(curFile,sHilite,eHilite)) returnFalse
  71.             equateLoc(curFile,locA,atCursor)
  72.             moveCursor(curFile,sHilite)
  73.             .. the line below appears to be needed in some cases when the
  74.             .. code is embedded at start of line.  Without it the printer
  75.             .. may not receive the code.
  76.             if (is(curFile,sLine)) insertChar(curFile,13)
  77.             printerCode(curFile,n53,0,0)
  78.             incNum(n53)
  79.             moveCursor(curFile,eHilite)
  80.             printerCode(curFile,n53,0,0)
  81.             equateLoc(curFile,eHilite,atCursor)
  82.             moveCursor(curFile,locA) >
  83.  
  84. Printer codes:  Next letter key brackets hilite for boldface, italics etc.
  85. <lAmiga-p:
  86.         if (runKey(virtual-g)) {
  87.             if (eqNum(n54,normal-h)) runKey(shftAltCtl-p)
  88.             else {
  89.                 equateNum(n53,-1)
  90.                 if (eqNum(n54,normal-8)) equateNum(n53,55)
  91.                 if (eqNum(n54,normal-i)) equateNum(n53,6)
  92.                 if (eqNum(n54,normal-u)) equateNum(n53,8)
  93.                 if (eqNum(n54,normal-b)) equateNum(n53,10)
  94.                 if (eqNum(n54,normal-e)) equateNum(n53,15)
  95.                 if (eqNum(n54,normal-c)) equateNum(n53,17)
  96.                 if (eqNum(n54,normal-l)) equateNum(n53,19)
  97.                 if (eqNum(n54,normal-s)) equateNum(n53,21)
  98.                 if (eqNum(n54,normal-d)) equateNum(n53,23)
  99.                 if (eqNum(n54,normal-n)) equateNum(n53,25)
  100.                 if (eqNum(n54,normal-x)) equateNum(n53,27)
  101.                 if (eqNum(n54,normal-y)) equateNum(n53,29)
  102.             if (eqNum(n53,-1)) returnFalse
  103.                 runKey(virtual-c)
  104.             } 
  105.         } >
  106.  
  107. Find next printer code (can delete it with ctl-h)
  108. <rAmiga-g:  freeBuf(buf54)
  109.             insertChar(buf54,"")
  110.             insertChar(buf54,wildCard)
  111.             insertChar(buf54,"")
  112.             insertChar(buf54,eitherOr)
  113.             insertChar(buf54,"")
  114.             insertChar(buf54,wildCard)
  115.             insertChar(buf54,wildCard)
  116.             insertChar(buf54,"")
  117.             setSearch(buf54)
  118.             if (search(curFile,sInvert,eInvert,1))
  119.             putMsg("Press ctl-i to delete the code") >
  120.  
  121. Insert printer code.  (See printer code table for meaning of numbers 0-75.)
  122. <lAmiga-g:  putMsg("Enter printer code (0-75, see printer-codes):")
  123.                 equateNum(n53,0)
  124.                 equateNum(n52,0)
  125.                 if (inputNum(n54)) {
  126.                     if (geNum(n54,0)) if (geNum(75,n54)) {
  127.                         if (eqNum(n54,12)) {
  128.                             putMsg("Enter foreground color (30-39)")
  129.                             goto label(2) }
  130.                         if (eqNum(n54,13)) {
  131.                             putMsg("Enter background color (40-49)")
  132.                             goto label(2) }
  133.                         if (eqNum(n54,48)) {
  134.                             putMsg("Enter proportional offset")
  135.                             goto label(2) }
  136.                         if (eqNum(n54,57)) {
  137.                             putMsg("Enter form length")
  138.                             goto label(2) }
  139.                         if (eqNum(n54,58)) {
  140.                             putMsg("Enter # lines to skip on perforation")
  141.                             goto label(2) }
  142.                         if (eqNum(n54,64)) {
  143.                             putMsg("Top/bottom margins, enter top margin")
  144.                             goto label(3) }
  145.                         if (eqNum(n54,65)) {
  146.                             putMsg("Left/right margins, enter left margin")
  147.                             goto label(3) }
  148.                         if (eqNum(n54,75)) {
  149.                             putMsg("Extended command - enter arg value")
  150.                             goto label(2) }
  151.                         goto label(1)
  152. label(3)
  153.                         if (not inputNum(n52)) return
  154.                         putMsg("Enter next value")
  155. label(2)
  156.                         if (not inputNum(n53)) return
  157.                         goto label(1)
  158. label(1)
  159.                         printerCode(curFile,n54,n53,n52)
  160.                     }
  161.                 }>
  162.  
  163. ======== PAGING CMDS ======
  164.  
  165. Erase next page number
  166. <lAmiga-y:
  167.     if (not is(curFile,eForm)) movecursor(curFile,eForm)
  168.     if (is(curFile,12)) return
  169.     if (not is(curFile,eLine)) moveCursor(curFile,eLine)
  170.     if (is(curFile,12)) runKey(alt-kp7)
  171. >
  172.  
  173. Input page number to go to
  174. <alt-3: putMsg("Go to page #:")
  175.         if (inputNum(n3)) gotoPage(curFile,n3) >
  176.  
  177. Insert a formfeed character
  178. <lAmiga-f:  insertChar(curFile,12) >
  179.  
  180. Go to top of page
  181. <lAmiga-h:  moveCursor(curFile,sForm) >
  182.  
  183. Go to end of page
  184. <lAmiga-b:  moveCursor(curFile,eForm) >
  185.  
  186. Insert page-division at cursor
  187. <lAmiga-v:
  188.     if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  189.     getPageRowCol(n50,n51,n52)
  190.     getLocal(curFile,n53,bottomMargin)
  191.     getLocal(curFile,n49,pageLines)
  192.     if (gtNum(2,n49)) {
  193.         putMsg("Must set lines/page > 1 first")
  194.         returnFalse
  195.     }
  196.     div(n53,n53,2)
  197.     add(n51,n51,n53)
  198.     while (gtNum(n49,n51)) { incNum(n51) insertChar(curFile,eLine) }
  199.     getLocal(curFile,n49,lineLength)
  200.     div(n49,n49,2)
  201.     while (gtNum(n49,0)) { insertChar(curFile," ") decNum(n49) }
  202.     toWord(curFile,n50)
  203.     insertChar(curFile,12)
  204.     if (not is(curFile,eFile)) {
  205.         getLocal(curFile,n54,topMargin)
  206.         while (gtNum(n54,0)) { decNum(n54) insertChar(curFile,eLine) }
  207.     }
  208. >
  209.  
  210. Delete next page-division
  211. <lAmiga-d:
  212.     label(1)
  213.     if (not is(curFile,sForm)) moveCursor(curFile,sForm)
  214.     if (not is(curFile,eForm)) moveCursor(curFile,eForm)
  215.     if (not is(curFile,eLine)) moveCursor(curFile,eline)
  216.     if (not is(curFile,12)) {
  217.         moveCursor(curFile,eChar)
  218.         if (not is(curFile,eFile)) goto label(1)
  219.         returnFalse
  220.     }
  221.     if (not is(curFile,sLine)) moveCursor(curFile,sLine)
  222.     getPageRowCol(n49,n50,n51)
  223.     getLocal(curFile,n54,topMargin)
  224.     getLocal(curFile,n53,bottomMargin)
  225.     equateLoc(curFile,locA,atCursor)        .. start of ff line
  226.     moveCursor(curFile,downLine)
  227.     while (gtNum(n54,0)) { .. del tm lines
  228.         if (not is(curFile,blankLine)) goto label(2)
  229.         decNum(n54)
  230.         moveCursor(curFile,downLine)
  231.     }
  232.     label(2)
  233.     equateLoc(curFile,locB,atCursor)
  234.     equateLoc(curFile,atCursor,locA)
  235.     moveCursor(curFile,upLine)
  236.     while (gtNum(n50,0)) {
  237.         decNum(n50)
  238.         if (not is(curFile,blankLine)) {
  239.             moveCursor(curFile,downLine)
  240.             goto label(3)
  241.         }
  242.         moveCursor(curFile,upLine)
  243.     }
  244.     label(3)
  245.     equateLoc(curFile,locA,atCursor)
  246.     clearRgn(curFile,loc)
  247. >
  248.  
  249. Auto-insert page-divisions and page-numbers in document
  250. <lAmiga-r:
  251.         putMsg("Scanning")
  252.         equateLoc(curFile,locA,atCursor)
  253.         freeBuf(buf54)
  254.         insertChar(buf54,12)
  255.         setSearch(buf54)
  256.         if (search(curFile,sInvert,eInvert,1)) {
  257.             putMsg("Delete old paging divisions first using lAmiga-d")
  258.             returnFalse
  259.         }
  260.         putMsg(" ")
  261.         equateLoc(curFile,atCursor,locA)
  262.         if (not is(curFile,sForm)) moveCursor(curFile,sForm)
  263.         while (nothing) {
  264.             moveCursor(curFile,eForm)
  265.             getLocal(curFile,n53,bottomMargin)
  266.             getPageRowCol(n50,n51,n52)
  267.             getLocal(curFile,n52,pageLines)
  268.             if (gtNum(2,n52)) {
  269.                 putMsg("Must set lines/page > 1 first")
  270.                 returnFalse
  271.             }
  272.             if (gtNum(n52,n51)) {  .. last page is short
  273.                 sub(n55,n52,n51)        .. page lines - real line
  274.                 while (gtNum(n52,n51)) {
  275.                     insertChar(curFile,eLine)
  276.                     incNum(n51)
  277.                 }
  278.                 do (n54,1,n53)  moveCursor(curFile,upLine)
  279.                 runKey(lAmiga-v)
  280.                 if (not is(curFile,eFile)) {
  281.                     moveCursor(curFile,eFile)
  282.                     runKey(lAmiga-v)
  283.                 }
  284.                 return
  285.             }
  286.             do (n54,1,n53)  moveCursor(curFile,upLine)
  287.             equateNum(n54,1)
  288.             while (is(curFile,blankLine)) {
  289.                 moveCursor(curFile,downLine)
  290.                 incNum(n54)
  291.                 if (geNum(n54,n53)) goto label(1)
  292.             }
  293.             label(1)
  294.             runKey(lAmiga-v)
  295.             moveCursor(curFile,downLine)
  296.             updateDisplay
  297.         }
  298. >
  299.  
  300.